<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <title>KISSY Menu Demo</title>
    <link href="../../../../../css/assets/dpl/base.css" rel="stylesheet"/>
    <link href="../../../../../menu/assets/dpl.css" rel="stylesheet"/>
</head>
<body>
<div class="container">
    <h1>KISSY Menu</h1>
</div>
<script>
    var start = new Date().valueOf();
</script>
<script src="/kissy/build/loader.js"></script>
<script>
    KISSY.use('menu', function (S, Menu) {
        new Menu({
            width: 200,
            render: '.container',
            listeners: {
                "click": function (e) {
                    var h;
                    if (h = e.target.get("href")) {
                        window.open(h);
                    }
                }
            },
            children: [
                {
                    content: "dpl",
                    href: 'demo/dpl/demo.html'
                },
                {
                    content: 'other',
                    xclass: 'submenu',
                    menu: {
                        children: [
                            {
                                content: '右键菜单',
                                href: 'demo/other/contextmenu.html'
                            },
                            {
                                content: '从已有节点产生',
                                href: 'demo/other/decorate.html'
                            },
                            {
                                content: '过滤菜单',
                                href: 'demo/other/filtermenu.html'
                            },
                            {
                                content: '大数据量测试',
                                href: 'demo/other/large.html'
                            },
                            {
                                content: '单菜单项',
                                href: 'demo/other/mouse-menubutton.html'
                            },
                            {
                                content: 'json 方式',
                                href: 'demo/other/simple_json.html'
                            },
                            {
                                content: '简单方式',
                                href: 'demo/other/simple.html'
                            },
                            {
                                content: '导航菜单',
                                href: 'demo/other/taolive/demo.html'
                            }
                        ]
                    }
                }
            ]
        }).render();

        S.log(S.Loader.Utils.now() - start);
    });


    KISSY.use('menu', function (S, Menu) {
        S.log(S.Loader.Utils.now() - start);
    });
</script>
</body>
</html>